package cn.thh.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private boolean success = true;

    private String message = "操作成功！";

    public AjaxResult() {
    }

    /**
     * 直接提供一个失败的构造函数
     * @param message
     */
    public AjaxResult(String message) {
        this.success = false;
        this.message = message;
    }

    public static AjaxResult me(){
        return new AjaxResult();
    }

   /* *//**
     * 链式编程思想
     * @param success
     * @return
     *//*
    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;
    }
*/
    /**
     * 链式编程思想
     * @param message
     * @return
     */
    public AjaxResult setMessage(String message) {
        this.success = false;
        this.message = message;
        return this;
    }
}
